package com.demo0;

/**
 * Colleague 具体的同事类  同事A
 * @author zhoujun
 * @date 2025/3/26 23:25
 */
public class ConcreteColleagueA extends Colleague {

    private ConcreteColleagueB colleagueB;

    public void setColleagueB(ConcreteColleagueB colleagueB) {
        this.colleagueB = colleagueB;
    }

    @Override
    public void send(String message){
        System.out.println("同事A发送消息给同事B:" + message);
        colleagueB.receive(message);
    }

    @Override
    void receive(String message) {
        System.out.println("同事A收到消息=" + message);
    }
}
